<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <artifactId>gs-docs</artifactId>
  <groupId>org.geoserver.en</groupId>
  <version>2.26-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>GeoServer English Documentation</name>
  <description>GeoServer English documentation</description>

  <licenses>
    <license>
      <name>Creative Commmons Attribution 4.0 International</name>
      <url>https://creativecommons.org/licenses/by/4.0/</url>
    </license>
  </licenses>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <target>full</target>
    <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
    <copyright.year>${maven.build.timestamp}</copyright.year>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </properties>
  
  <dependencies>
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.8.1</version>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>copy-resources</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.basedir}/target/html-template</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/../../src/release/src/markdown/html</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.ruleoftech</groupId>
        <artifactId>markdown-page-generator-plugin</artifactId>
        <version>2.4.0</version>
        <executions>
          <execution>
            <id>html</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <recursiveInput>false</recursiveInput>
              <inputDirectory>${project.basedir}</inputDirectory>
              <outputDirectory>${project.build.directory}/html</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>readme</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <applyFiltering>true</applyFiltering>
              <inputDirectory>${project.basedir}/release</inputDirectory>
              <outputDirectory>${project.build.directory}/html</outputDirectory>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
          <headerHtmlFile>${project.basedir}/target/html-template/header.html</headerHtmlFile>
          <footerHtmlFile>${project.basedir}/target/html-template/footer.html</footerHtmlFile>
          <pegdownExtensions>TABLES,FENCED_CODE_BLOCKS,AUTOLINKS,FORCELISTITEMPARA</pegdownExtensions>
          <defaultTitle>true</defaultTitle>
          <inputFileExtensions>md</inputFileExtensions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.swagger</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <version>2.4.12</version>
        <configuration>
          <language>html</language>
          <ignoreFileOverride>${project.basedir}/api/.swagger-codegen-ignore</ignoreFileOverride>
          <inputSpec/>
        </configuration>
        <executions>
          <!-- one execution per page -->
          <execution>
            <id>coverages</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/coverages.yaml</inputSpec>
              <output>${project.build.directory}/api/coverages</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>coverageStores</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/coveragestores.yaml</inputSpec>
              <output>${project.build.directory}/api/coveragestores</output>
            <language/>
            </configuration>
          </execution>
          <execution>
            <id>datastores</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/datastores.yaml</inputSpec>
              <output>${project.build.directory}/api/datastores</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>featureTypes</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/featuretypes.yaml</inputSpec>
              <output>${project.build.directory}/api/featuretypes</output>
              <language/>
            </configuration>
          </execution>          
          <execution>
            <id>fonts</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/fonts.yaml</inputSpec>
              <output>${project.build.directory}/api/fonts</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcblobstores</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcblobstores.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcblobstores</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcbounds</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcbounds.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcbounds</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcdiskquota</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcdiskquota.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcdiskquota</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcfilterupdate</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcfilterupdate.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcfilterupdate</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcglobal</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcglobal.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcglobal</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcgridsets</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcgridsets.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcgridsets</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcindex</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcindex.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcindex</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwclayers</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwclayers.yaml</inputSpec>
              <output>${project.build.directory}/api/gwclayers</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcmasstruncate</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcmasstruncate.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcmasstruncate</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcmemorycachestatistics</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcmemorycachestatistics.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcmemorycachestatistics</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcreload</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcreload.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcreload</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>gwcseed</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/gwcseed.yaml</inputSpec>
              <output>${project.build.directory}/api/gwcseed</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>importer</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/importer.yaml</inputSpec>
              <language>html</language>
              <ignoreFileOverride>${project.basedir}/api/.swagger-codegen-ignore</ignoreFileOverride>
              <output>${project.build.directory}/api/importer</output>
            </configuration>
          </execution>
          <execution>
            <id>importerData</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/importerData.yaml</inputSpec>
              <language>html</language>
              <ignoreFileOverride>${project.basedir}/api/.swagger-codegen-ignore</ignoreFileOverride>
              <output>${project.build.directory}/api/importerData</output>
            </configuration>
          </execution>
          <execution>
            <id>importerTasks</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/importerTasks.yaml</inputSpec>
              <output>${project.build.directory}/api/importerTasks</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>importerTransforms</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/importerTransforms.yaml</inputSpec>
              <output>${project.build.directory}/api/importerTransforms</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>layergroups</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/layergroups.yaml</inputSpec>
              <output>${project.build.directory}/api/layergroups</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>layers</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/layers.yaml</inputSpec>
              <output>${project.build.directory}/api/layers</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>manifests</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/manifests.yaml</inputSpec>
              <output>${project.build.directory}/api/manifests</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>metadata</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/metadata.yaml</inputSpec>
              <output>${project.build.directory}/api/metadata</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>monitoring</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/monitoring.yaml</inputSpec>
              <output>${project.build.directory}/api/monitoring</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>namespaces</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/namespaces.yaml</inputSpec>
              <output>${project.build.directory}/api/namespaces</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>opensearch-eo</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/opensearch-eo.yaml</inputSpec>
              <output>${project.build.directory}/api/opensearch-eo</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>owsservices</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/owsservices.yaml</inputSpec>
              <output>${project.build.directory}/api/owsservices</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>params-extractor</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/params-extractor.yaml</inputSpec>
              <output>${project.build.directory}/api/params-extractor</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>reload</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/reload.yaml</inputSpec>
              <output>${project.build.directory}/api/reload</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>resource</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/resource.yaml</inputSpec>
              <output>${project.build.directory}/api/resource</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>roles</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/roles.yaml</inputSpec>
              <output>${project.build.directory}/api/roles</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>security</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/security.yaml</inputSpec>
              <output>${project.build.directory}/api/security</output>
              <language/>
            </configuration>
          </execution>          
          <execution>
            <id>settings</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/settings.yaml</inputSpec>
              <output>${project.build.directory}/api/settings</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>structuredCoverages</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/structuredcoverages.yaml</inputSpec>
              <output>${project.build.directory}/api/structuredcoverages</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>styles</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/styles.yaml</inputSpec>
              <output>${project.build.directory}/api/styles</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>system-status</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/system-status.yaml</inputSpec>
              <output>${project.build.directory}/api/system-status</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>templates</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/templates.yaml</inputSpec>
              <output>${project.build.directory}/api/templates</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>transforms</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/transforms.yaml</inputSpec>
              <output>${project.build.directory}/api/transforms</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>usergroup</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/usergroup.yaml</inputSpec>
              <output>${project.build.directory}/api/usergroup</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>wmslayers</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/wmslayers.yaml</inputSpec>
              <output>${project.build.directory}/api/wmslayers</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>wmsstores</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/wmsstores.yaml</inputSpec>
              <output>${project.build.directory}/api/wmsstores</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>wmtslayers</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/wmtslayers.yaml</inputSpec>
              <output>${project.build.directory}/api/wmtslayers</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>wmtsstores</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/wmtsstores.yaml</inputSpec>
              <output>${project.build.directory}/api/wmtsstores</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>workspaces</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/workspaces.yaml</inputSpec>
              <output>${project.build.directory}/api/workspaces</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>wpsdownload</id>
            <phase>process-resources</phase>
            <goals><goal>generate</goal></goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/wpsdownload.yaml</inputSpec>
              <output>${project.build.directory}/api/wpsdownload</output>
              <language/>
            </configuration>
          </execution>
          <execution>
            <id>urlchecks</id>
            <phase>process-resources</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/api/1.0.0/urlchecks.yaml</inputSpec>
              <output>${project.build.directory}/api/urlchecks</output>
              <language/>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <!-- documentation build -->
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>3.1.0</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.10.12</version>
          </dependency>
          <dependency>
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
          </dependency>
        </dependencies>
        <executions>
           <execution>
            <id>version</id>
            <phase>process-resources</phase>
            <configuration>
              <target>
                 <copy file="release/VERSION.txt" todir="target" filtering="true">
                  <filterset begintoken="$${" endtoken="}">
                    <filter token="project.version" value="${project.version}"/>
                    <!--suppress UnresolvedMavenProperty -->
                    <filter token="build.revision" value="${build.commit.id}"/>
                    <!--suppress UnresolvedMavenProperty -->
                    <filter token="build.branch" value="${build.branch}"/>
                    <!--suppress UnresolvedMavenProperty -->
                    <filter token="build.timestamp" value="${build.timestamp}"/>
                    <!--suppress UnresolvedMavenProperty -->
                    <filter token="build.hudsonId" value="${build.hudsonId}"/>
                  </filterset>
                 </copy>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
          <execution>
            <id>sphinx</id>
            <phase>compile</phase>
            <configuration>
              <target>
                <ant antfile="build.xml" dir="${basedir}" target="${target}">
                  <property name="build.directory" value="${project.build.directory}"/>
                  <property name="project.version" value="${project.version}"/>
                </ant>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <finalName>geoserver-${project.version}</finalName>
        </configuration>
        <executions>
          <execution>
            <id>api</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>release/api.xml</descriptor>
              </descriptors>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
          <execution>
            <id>user</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>release/user.xml</descriptor>
              </descriptors>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
          <execution>
            <id>developer</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>release/developer.xml</descriptor>
              </descriptors>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
          <execution>
            <id>docguide</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>release/docguide.xml</descriptor>
              </descriptors>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
          <execution>
            <id>htmldoc</id>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>release/htmldoc.xml</descriptor>
              </descriptors>
            </configuration>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  
  <!-- sphinx build targets - default to full -->
  <profiles>
    <profile>
      <id>docguide</id>
      <properties>
        <target>docguide</target>
      </properties>
    </profile>
    <profile>
      <id>user</id>
      <properties>
        <target>user</target>
      </properties>
    </profile>
    <profile>
      <id>user-pdf</id>
      <properties>
        <target>user-pdf</target>
      </properties>
    </profile>
    <profile>
      <id>developer</id>
      <properties>
        <target>developer</target>
      </properties>
    </profile>
  </profiles>
  
</project>
